package com.bangdao.app.jetpacktest.jetpack.databinding;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.TextView;

import com.bangdao.app.jetpacktest.R;
import com.bangdao.app.jetpacktest.jetpack.databinding.bean.Book;

public class NomalBindingActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_data_binding_normal);

        TextView tvTitle = findViewById(R.id.tvTitle);
        TextView tvAuthor = findViewById(R.id.tvAuthor);
        TextView tvRating = findViewById(R.id.tvRating);

        Book book = new Book("Java编程思想", "大佬", 5);

        tvTitle.setText(book.getTitle());
        tvAuthor.setText(book.getAuthor());
        tvRating.setText(book.getRating()+"");
    }
}